package com.homework;

/**
 * @author :  DongZheng Wang
 * @PROJECT_NAME: java泛型
 * @date :  2022-10-25 16:39
 **/
public class Four {
    public static void main(String[] args) {
        F<String> ob = new F<>();
        ob.doSomething("泛型是不固定的");
        F<Integer> ob1 = new F<>();
        ob1.doSomething(1);
        F1 f1 = new F1();
        f1.doSomething("该类不是泛型");
    }
}

interface Fours<T>{
    public void doSomething(T t);
}
class F<T> implements Fours<T>{

    @Override
    public void doSomething(T t) {
        System.out.println("T="+t);
    }

}
class F1 implements Fours<String>{

    @Override
    public void doSomething(String s) {
        System.out.println("s="+s);
    }
}